package com.jswdwsx.common.utils;

import org.springframework.http.HttpHeaders;

public class HeaderUtil {

    private final static String alert = "X-TB-alert";
    private final static String error = "X-TB-error";

    public static HttpHeaders alert(String message) {
        HttpHeaders headers = new HttpHeaders();
        headers.add(alert, message);
        return headers;
    }

    public static HttpHeaders saveAlert(String name, String params) {
        HttpHeaders headers = new HttpHeaders();
        headers.add(alert, "A " + name + " is saved by " + params);
        return headers;
    }

    public static HttpHeaders deleteAlert(String name, String params) {
        HttpHeaders headers = new HttpHeaders();
        headers.add(alert, "A " + name + " is deleted by " + params);
        return headers;
    }

    public static HttpHeaders errorAlert(String message) {
        HttpHeaders headers = new HttpHeaders();
        headers.add(error, message);
        return headers;
    }

}
